<?=form_open('raovat/edit/'.(int)$this->uri->segment(3).'/'.(int)$this->uri->segment(4),array('id'=>'adminformraovat'));?>
<input type="hidden" name="raovat_id" id="raovat_id" value="<?=$rs->raovat_id?>">
<div class="cm-tabs-content">
    <div id="content_detailed">
        <!--<h2 class="subheader">Thông tin</h2>-->
        <table class="form" width="100%">
            <tr>
                <td width="259" class="required label">Tên sản phẩm</td>
                <td><input type="text" id="lb_subject" class=" max" name="lb_subject" value="<?=$rs->lb_subject?>"></td>
            </tr>
            <tr>
                <td class="label">Hình ảnh</td>
                <td><input type="text" name="lb_images" id="lb_images"class="w350" value="<?=$rs->lb_images?>" />
                    <a href="<?=base_url()?>filemanager/index/lb_images" class="popupbox" title="Thêm File"> <img src="<?=base_url()?>templates/images/icon/attach.png" alt=""> </a></td>
            </tr>
            <tr>
                <td class="required label">Nơi đăng tin</td>
                <td><select name="town_id" id='town_id'>
                        <option value="0">== chọn ==</option>
                        <? foreach($town as $row):?>
                        <option value="<?=$row->town_id?>"><?=$row->town_name?> </option>
                        <? endforeach;?>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="required label">Danh mục sản phẩm</td>
                <td><select name="class_id" id="class_id">
                		<option value="0">== chọn ==</option>
                        <? foreach($category as $cat): ?>
                        <option value="<?=$cat->class_id?>"> <?=$cat->class_name?> </option>
                        <? endforeach;?>
                    </select></td>
            </tr>
            <script language="javascript">
				mkselect('town_id', '<?=$rs->town_id?>');
				mkselect('class_id', '<?=$rs->class_id?>');
            </script>
            
            <tr>
                <td class="label">Tính năng</td>
                <td><textarea id="wysiwyg-advanced" name="content"><?=$rs->lb_content?></textarea></td>
            </tr>
            <tr>
                <td class="required label">Hiển thị</td>
                <td><input type="checkbox" name="bl_active" value="1" <?=($rs->bl_active==1)?'checked="checked"':'';?>></td>
            </tr>
        </table>
    </div>
</div>
<div style="text-align:center">
    <input type="submit" name="bt_submit" value="" class="capnhat">
</div>
<?=form_close();?>
<script type="text/javascript">
     $("#adminformraovat").validate({
        rules: {
            lb_subject: "required",
            class_id: "required",
        },
        messages: {
            lb_subject: "Vui lòng điền tiêu đề tin",
            class_id: "Vui lòng chọn ngành nghề.",
        }
    });
     
</script> 
